וַיֹּאמֶר֩ דָּוִ֨ד אֶל־יְהוָ֜ה בִּרְאֹת֣וֹ ׀ אֶֽת־הַמַּלְאָ֣ךְ ׀ הַמַּכֶּ֣ה בָעָ֗ם וַיֹּ֙אמֶר֙ הִנֵּ֨ה אָנֹכִ֤י חָטָ֙אתִי֙ וְאָנֹכִ֣י הֶעֱוֵ֔יתִי וְאֵ֥לֶּה הַצֹּ֖אן מֶ֣ה עָשׂ֑וּ תְּהִ֨י נָ֥א יָדְךָ֛ בִּ֖י וּבְבֵ֥ית אָבִֽי׃ (פ)
און דוד האָט גערעדט צו גאָט, װען ער האָט געזען דעם מלאך װאָס שלאָגט צװישן פֿאָלק, און ער האָט געזאָגט: זע, איך האָב געזינדיקט, און איך האָב פֿאַרבראָכן, אָבער די דאָזיקע שאָף, װאָס האָבן זײ געטאָן? זאָל, איך בעט דיך, דײַן האַנט זײַן אױף מיר און אױף מײַן פֿאָטערס הױז.
Mekhilta DeRabbi Yishmael
R. Yochanan said: Jonah went (on that voyage) only to cast himself into the sea, as it is written (Jonah 1:12) "And he said to them: Lift me up and cast me into the sea." All this do you find with Moses and the (other) prophets, that they gave their lives for Israel. What is written of Moses? (Exodus 32:32) "And now, if You forgive their sin — and if not, blot me out of Your book which You have written." (Numbers 11:15) "If thus You do with me, kill me if I have found favor in Your eyes and let me not look upon my evil" (i.e., the destruction of Israel). What is written of David? (II Samuel 24:17) "Behold, I have sinned and I have been corrupt. But these sheep, what have they done? Let Your hand be in me and in the house of my father." In all places you find that Moses and the (other) prophets gave their lives for Israel.
Pirkei DeRabbi Eliezer
Rabbi Abbahu said: Know thou the power of repentance. Come and see from David, king of Israel. For the Holy One, blessed be He, had sworn to the forefathers that He would multiply their seed like the stars of the heavens. And David came to count their number. The Holy One, blessed be He, said to him: David ! I have sworn to the forefathers that I would multiply their seed as the stars of the heavens. And thou comest to annul My word. For thy sake the flock is given over to destruction; and in three hours there fell seventy thousand men, as it is said, "And there fell of Israel seventy thousand men" (1 Chron. 21:14). Rabbi Simeon said: Only Abishai, son of Zeruiah, fell amongst the Israelites, for he was equal in his good deeds and his knowledge of the Torah to the seventy thousand men, as it is said, "And there fell of Israel seventy thousand men" (ibid.). "Men" is not written here, only "man." And David heard and rent his garments, and clothed himself in sackcloth and ashes, and he fell upon his face to the ground before the ark of the covenant of God.
Sifrei Devarim
(Ibid.) "All of his holy ones are in Your hand": These are the leaders of Israel, who stand over Israel and (are ready to) give up their lives for them. Of Moses it is written (Shemoth 32:32) "And now if You will bear their sin, (good), but if not, erase me, I pray You, from Your book that You have written." Of David it is written (II Samuel 24:17) "I have sinned and I have transgressed, but these sheep, what have they done?"